Rovo Dev CLI でサーバー モードを使用する
Rovo Dev CLI でサーバー モードを使用する
サーバー モードで起動する
# Basic usage
rovodev serve 8123
# With initial message
rovodev serve 8123 "Open the README file"
# With shadow mode enabled
rovodev serve 8123 --shadowサーバーが実行されていることを確認するには、次のようにします。
curl http://localhost:8123/healthcheck
# Response: {"status":"healthy","version":"0.11.26","mcp_servers":{"filesystem-tools":"running","atlassian":"running","bitbucket":"running"}}チャット ワークフロー
チャット メッセージを設定する
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Open a file and describe it", "enable_deep_plan": false}'ストリーム応答
Rovo Dev の応答をリアルタイムに示すサーバー送信イベントのストリームを返します。
curl http://localhost:8123/v3/stream_chat --no-buffer綿密な計画に対応したチャット
綿密な計画とは、変更を実行する前に技術的な計画を作成するものであり、複雑な変更に役立ちます。
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Refactor the main.py file to use better error handling", "enable_deep_plan": true}'
curl http://localhost:8123/v3/stream_chat --no-bufferツール呼び出しでの一時停止
ツール呼び出しでの一時停止は任意ですが、ツール権限フローを有効化する場合は推奨されます。一時停止中は、ツール呼び出しを承認または拒否できます。
curl "http://localhost:8123/v3/stream_chat?pause_on_call_tools_start=true" --no-bufferツール実行を承認するには、次のようにします。
curl -X POST http://localhost:8123/v3/resume_tool_calls \
-H "Content-Type: application/json" \
-d '{
"decisions": [
{
"tool_call_id": "toolu_vrtx_01CtgADk2XWPu4jhKVwiKaeP",
"deny_message": null
}
]
}'セッション管理
curl http://localhost:8123/v3/sessions/list | jq . - すべてのセッションをリストします。
curl http://localhost:8123/v3/sessions/current_session | jq . - 現在のセッションの情報を取得します。
curl -X POST http://localhost:8123/v3/sessions/create | jq . - 新しいセッションを作成します。
curl -X POST http://localhost:8123/v3/sessions/{session_id}/restore | jq . - 以前のセッションを復元します。
curl -X POST http://localhost:8123/v3/replay --no-buffer - セッション履歴をリプレイします。
ツール管理
curl http://localhost:8123/v3/tools | jq . - 利用可能なすべてのツールをリストします。
ツールを直接実行するには、次のようにします。
curl -X POST http://localhost:8123/v3/tool \
-H "Content-Type: application/json" \
-d '{
"tool_name": "open_files",
"arguments": {
"file_paths": ["README.md"]
}
}' | jq .ファイル キャッシュ管理
curl "http://localhost:8123/v3/cache-file-path?file_path=README.md" | jq . - キャッシュされたファイルのパスを取得します。
curl -X POST http://localhost:8123/v3/invalidate-file-cache | jq . - ファイル キャッシュを無効化します。
制御操作
curl -X POST http://localhost:8123/v3/cancel | jq . - 進行中のチャットをキャンセルします。
curl -X POST http://localhost:8123/v3/reset | jq . - エージェントの状態をリセットします。
curl -X POST http://localhost:8123/v3/prune | jq . - エージェントの履歴を削除します。
プログラミング言語の例
Python:
import requests
import json
# Start a chat
set_response = requests.post(
"http://localhost:8123/v3/set_chat_message",
json={"message": "List files in the project", "enable_deep_plan": False}
)
response = requests.get("http://localhost:8123/v3/stream_chat", stream=True)
# Process streaming response
for line in response.iter_lines():
if line:
line = line.decode('utf-8')
if line.startswith('data: '):
data = json.loads(line[6:])
print(f"Event: {data}")
Javascript:
// First, set the chat message
await fetch('http://localhost:8123/v3/set_chat_message', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: "Explain the project structure",
enable_deep_plan: false
})
});
// Then stream the response
const eventSource = new EventSource('http://localhost:8123/v3/stream_chat');
eventSource.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log('Received:', data);
};
eventSource.onerror = function(event) {
console.error('Error:', event);
};
curl と jq (出力整形):
# First, set the chat message
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Show me the project structure"}'
# Then stream and format JSON events
curl -X GET http://localhost:8123/v3/stream_chat \
--no-buffer | while IFS= read -r line; do
if [[ $line == data:* ]]; then
echo "$line" | sed 's/^data: //' | jq .
fi
doneユース ケースの例
コード分析:
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Analyze the main.py file and suggest improvements"}'
curl -X GET http://localhost:8123/v3/stream_chat \
--no-buffer | while IFS= read -r line; do
if [[ $line == data:* ]]; then
echo "$line" | sed 's/^data: //' | jq .
fi
done
ファイル操作:
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Create a new Python file with a basic FastAPI setup"}'
curl -X GET http://localhost:8123/v3/stream_chat \
--no-buffer | while IFS= read -r line; do
if [[ $line == data:* ]]; then
echo "$line" | sed 's/^data: //' | jq .
fi
done
テスト:
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Run the tests and show me any failures"}'
curl -X GET http://localhost:8123/v3/stream_chat \
--no-buffer | while IFS= read -r line; do
if [[ $line == data:* ]]; then
echo "$line" | sed 's/^data: //' | jq .
fi
done
ドキュメント作成:
curl -X POST http://localhost:8123/v3/set_chat_message \
-H "Content-Type: application/json" \
-d '{"message": "Generate documentation for the API endpoints"}'
curl -X GET http://localhost:8123/v3/stream_chat \
--no-buffer | while IFS= read -r line; do
if [[ $line == data:* ]]; then
echo "$line" | sed 's/^data: //' | jq .
fi
doneサーバー モードのヒント
リファクタリングなどの複雑なタスクに対しては綿密な計画を有効化します。
curl で常に
--no-bufferを使用し、SSE イベントを正しく処理します。異なるコンテキストまたはタスクには新しいセッションを作成します。
この内容はお役に立ちましたか?